package com.job.dao;

import com.job.pojo.Info;
import com.job.pojo.Offer;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface InfoDao {

    //查询
    @Select("select * from userInfo")
    List<Info>selectAll();
    @Select("select * from userInfo where userId=#{userId}")
    List<Info>selectId(Info info);
    @Select("select * from userInfo where userName=#{userName}")
    List<Info>selectName(Info info);


    //删除
    @Delete("delete  from userInfo where userId=#{userId}")
    int del(Info info);

    //新增
    @Insert("insert into userInfo(userName,userId,sex,birth,phone,job,type,ps,school)" +
            "value(#{userName},#{userId},#{sex},#{birth},#{phone},#{job},#{type},#{ps},#{school})")
    int add(Info info);



    //修改：

    @Update("update userInfo set userName=#{userName}, phone=#{phone},type=#{type},job=#{job},sex=#{sex},birth=#{birth},school=#{school},ps=#{ps}" +
            " where userId=#{userId}")
    int update(Info info);
}
